# Simple examples with random data here
# Real data examples in the Vignette
# Random data: covariates A,B,C are correlated with Y
Y <- rnorm(20)
X <- matrix(rnorm(200), 20, 10)
X[,1:3] <- X[,1:3] + 0.5*Y
colnames(X) <- LETTERS[1:10]
# Make a gt.object
sets <- list(odd = c(1,3,5,7,9), even = c(2,4,6,8,10))
res <- gt(Y, X, subsets=sets)
# Show the results
res
summary(res)
sort(res)
p.value(res)
subsets(res)
# Names
names(res)
names(res) <- c("ODD", "EVEN")
alias(res) <- c("odd covariates", "even covariates")
# Multiple testing
p.adjust(res, method = "holm")
p.adjust(res, method = "BH")
# Diagnostics
weights(res)
covariates(res[1])
extract(covariates(res[1]))
subjects(res[1])
# Permutation testing
res <- gt(Y, X, perm = 1e4)
hist(res)
Run the code above in your browser using DataLab